package com.stm.bi.web;

import com.stm.bi.dto.vo.MaterialTableDataVO;
import com.stm.framework.annotation.Module;
import com.stm.framework.annotation.RestApi;
import com.stm.framework.dto.Response;
import com.stm.bi.dto.query.ProductMaterialQry;
import com.stm.bi.dto.vo.*;
import com.stm.bi.service.ReportService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
*
*
* @author chenyingjun
* @date 2023-05-09
*/
@RestController
@RequestMapping("/report")
@Module("实绩查询")
public class ReportController {
    @Resource
    private ReportService reportService;


/*
    @PostMapping(value = "/prodData/processChart")
    @RestApi(name = "商品推移-合计推移图",author = "阿俊",idx=1)
    public Response<DimensionChartVO> selectChart(@RequestBody ReportQry reportQry){
        return reportService.queryChart(reportQry);
    }

    @PostMapping(value = "/prodData/processDetailChart")
    @RestApi(name = "商品推移-推移明细图",author = "阿俊",idx=2)
    public Response<DimensionChartVO> selectDetailChart(@RequestBody ReportQry reportQry){
        return reportService.queryDetailChart(reportQry);
    }

    @PostMapping(value = "/prodData/table")
    @RestApi(name = "商品推移-推移表",author = "阿俊",idx=3)
    public Response<DimensionTableDataVO> selectTable(@RequestBody ReportQry reportQry){
        return reportService.queryTable(reportQry);
    }

    @PostMapping(value = "/prodData/export")
    @RestApi(name = "商品推移-导出",author = "wsb",idx=4)
    public Response export(HttpServletResponse response,@RequestBody ReportQry reportQry){
        return reportService.export(response, reportQry);
    }
*/

    @PostMapping(value = "/prodMaterial/materialApply")
    @RestApi(name = "商品面料-面料应用",author = "zp",idx=5)
    public Response<MaterialTableDataVO> materialApply(@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.materialApply(productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/materialApplyExport")
    @RestApi(name = "商品面料-面料应用(导出)",author = "zp",idx=6, permission = "bi:report:material:export")
    public Response<MaterialTableDataVO> materialApplyExport(HttpServletResponse response,@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.materialApplyExport(response,productMaterialQry);
    }

    @GetMapping(value = "/prodMaterial/materialCategoryList")
    @RestApi(name = "商品面料-面料分类列表",author = "zp",idx=7)
    public Response<List<ValueVO>> materialCategoryList(){
        return reportService.materialCategoryList();
    }

    @PostMapping(value = "/prodMaterial/materialList")
    @RestApi(name = "商品面料-面料列表",author = "zp",idx=8)
    public Response<List<ValueVO>> materialList(@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.materialList(productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/styleDetail")
    @RestApi(name = "商品面料-款式明细",author = "zp",idx=9)
    public Response<MaterialTableDataVO> styleDetail(@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.styleDetail(productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/styleDetailExport")
    @RestApi(name = "商品面料-款式明细(导出)",author = "zp",idx=10)
    public Response<MaterialTableDataVO> styleDetailExport(HttpServletResponse response,@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.styleDetailExport(response,productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/materialDetail")
    @RestApi(name = "商品面料-面料明细",author = "zp",idx=11)
    public Response<MaterialTableDataVO> materialDetail(@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.materialDetail(productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/materialDetailExport")
    @RestApi(name = "商品面料-面料明细(导出)",author = "zp",idx=12)
    public Response<MaterialTableDataVO> materialDetailExport(HttpServletResponse response,@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.materialDetailExport(response,productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/utilizationEfficiency")
    @RestApi(name = "商品面料-利用效率",author = "liuyx",idx=13)
    public Response<MaterialTableDataVO> utilizationEfficiency(@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.utilizationEfficiency(productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/utilizationEfficiencyExport")
    @RestApi(name = "商品面料-利用效率(导出)",author = "liuyx",idx=14)
    public Response<MaterialTableDataVO> utilizationEfficiencyExport(HttpServletResponse response, @RequestBody ProductMaterialQry productMaterialQry){
        return reportService.utilizationEfficiencyExport(response, productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/utilizationEfficiencyDetail")
    @RestApi(name = "商品面料-利用效率明细",author = "zp",idx=15)
    public Response<MaterialTableDataVO> utilizationEfficiencyDetail(@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.utilizationEfficiencyDetail(productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/utilizationEfficiencyDetailExport")
    @RestApi(name = "商品面料-利用效率明细(导出)",author = "zp",idx=16)
    public Response<MaterialTableDataVO> utilizationEfficiencyDetailExport(HttpServletResponse response,@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.utilizationEfficiencyDetailExport(response,productMaterialQry);
    }

    @PostMapping(value = "/prodMaterial/utilizationEfficiencyChart")
    @RestApi(name = "商品面料-利用效率明细图表",author = "zp",idx=17)
    public Response<UtilizationEfficiencyChartVO> utilizationEfficiencyChart(@RequestBody ProductMaterialQry productMaterialQry){
        return reportService.utilizationEfficiencyChart(productMaterialQry);
    }
}
